package utils;

import domain.Product;

import java.util.List;

/**
 * Created by Administrator on 2017/10/30.
 */
public class PageBean {
    //前端传入
    private int currenPage;//第几页
    private int pageSize;//当前页面数据条数

    //计算：count/pageSize
    private int pageCount;//一共多少页

    //从数据库查出
    private List<Product> pageList;//当前页的数据列表
    private int count;//数据库中一共多少条数据

    public int getCurrenPage() {
        return currenPage;
    }

    public void setCurrenPage(int currenPage) {
        this.currenPage = currenPage;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getPageCount() {
        //计算一共多少页
        int a=count/pageSize;
        pageCount=count%pageSize==0?a:a+1;
        return pageCount;
    }

    public void setPageCount(int pageCount) {
        this.pageCount = pageCount;
    }

    public List<Product> getPageList() {
        return pageList;
    }

    public void setPageList(List pageList) {
        this.pageList = pageList;
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }
}
